//
//  PKBaseViewController.m
//  Awhile
//
//  Created by lanou on 15/9/25.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "PKBaseViewController.h"

@interface PKBaseViewController ()
@end

@implementation PKBaseViewController
-(UIView *)topView
{
    if (!_topView) {
        _topView = [[UIView alloc]initWithFrame:CGRectMake(0, 20, [UIScreen mainScreen].bounds.size.width, 50)];
        _topView.backgroundColor = [UIColor whiteColor];
        [_topView addSubview:self.titleLabel];
        [_topView addSubview:self.leftButton];
        [self.view addSubview:_topView];
    }
    return _topView;
}
-(UILabel *)titleLabel
{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(50, 10, 100, 30)];
    }
    return _titleLabel;
}
-(UIButton *)leftButton
{
    if (!_leftButton) {
        _leftButton = [UIButton buttonWithType:(UIButtonTypeSystem)];
        _leftButton.frame = CGRectMake(5, 10, 32, 32);
        _leftButton.backgroundColor = [UIColor redColor];
        [_leftButton addTarget:self action:@selector(changeViewFram:) forControlEvents:(UIControlEventTouchUpInside)];

    }
    return _leftButton;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    NSLog(@"%@",self.topView);
}

- (void)changeViewFram:(UIButton *)button
{
    [self.changeFrameVC changeFrame];
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
